using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeWeb;
using System.Transactions;
using GC2.Entities.Admin;
using GC2.ExceptionHandler.Services;
using GC2.DataAccess.DAAdmin;

namespace GC2.Bussines.BMAdmin
{
    public class BMRecibos
     {
        public BMRecibos(string coneccion)
        {
            this.Connection = coneccion;
        }

        private string connection = "";
        public string Connection
        {
            get { return connection; }
            set { connection = value; }
        }

        private Recibos oRecibo = new Recibos();
        private DARecibos daRecibos = new DARecibos();


        #region BMRecibosInsert
        public Recibos BMRecibosInsert(Recibos recibo)
        {
            try
            {
                recibo = daRecibos.DARecibosInsert(connection, recibo);
                return recibo;
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMRecibosProximoId
        public Recibos BMRecibosProximoId()
        {
            oRecibo = new Recibos();
            try
            {
                oRecibo = daRecibos.DARecibosProximoId(connection);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
            return oRecibo;
        }
        #endregion

    }
}